<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>奖品概率列表</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1.0" />
    <#include "/view/admin/head.html"/>
    <style type="text/css">
        .table-class{
            width:80%;
            text-align: center;
            border:1px solid #afd9ee;
            margin:0 auto;
            margin-top: 50px;
        }
        .list-path{
            height: 50px;
            line-height: 50px;
            background-color: #9acfea;

        }
        table th{
            text-align: center;
        }
        table thead tr {
            background-color: #9acfea;
        }
        .table-query{
            /*height: 40px;*/
            /*width:80px;*/
            /*text-align: center;*/
            white-space:nowrap;

        }
    </style>
    <script type="text/javascript">
        function query(dm){
            var val = $('#q').val();
            var sel = $('#approveStatus').val();
            location.href='${base}/approve/list.do?q='+val+'&approveStatus='+sel;
        }
    </script>
</head>
<body>

<div class="list-path" > <span style="margin-left: 50px;"><span class="glyphicon glyphicon-home"></span> 奖品概率列表</span></div>
      

<div class="table-class">
    <!--<div class="table-query">-->

<!--         <div class="input-group table-query" style="margin-top:25px;margin-left: 50px;">
            <input type="text" class="form-control" id="q" name="q" value="${q!}" placeholder="姓名/别名/手机号" style="width: 200px;" >
              <select id="approveStatus" name="approveStatus" class="form-control" style="width: 150px;">
                <option value="">请选择...</option>
                <option value="0" <#if approveStatus??&&'0' == approveStatus>selected="selected"</#if>>审批中</option>
                <option value="1" <#if approveStatus??&&'1' == approveStatus>selected="selected"</#if>>审批通过</option>
                <option value="2" <#if approveStatus??&&'2' == approveStatus>selected="selected"</#if>>审批不通过</option>
            </select>
            <a class="btn btn-info" href="javascript:query(this)"><span class="glyphicon glyphicon-search"></span> 查找</a>


        </div> -->
      <#if  message??  >
        <div class="alert alert-error" style="background-color: write;color: red;">           
           <font size="5"><strong>${message!}</strong></font>
        </div>
     </#if>
      <hr/>
      
    <div style="text-align:left;  padding:10px;">
    <@shiro.hasPermission name="10.1.1.3">	
		<input type="button" class="btn btn-primary" value="新增" onclick="javascript:location.href='czjawardonAdd.do?shopId=${shopId!}'"/>
    </@shiro.hasPermission>     
   </div>
         
    <table class="table table-hover table-bordered">
        <thead>
        <tr>
	    	 
   	 <th>奖品名称</th>
   	 <th>奖品概率</th>
   	 <th>奖品展示顺序</th>
     <th width="200">操作选项</th>
        </tr>
        </thead>
        <tbody>
        <#list pagination.list as c>
            <tr>

 <td>${c.thingName!?html}</td>
 <td>${c.probability!?html}</td>
  <td>    
    ${c.ext1!?html}
 </td>
	<td align="center">	
<@shiro.hasPermission name="10.1.1.1">		
   <a href="czjawardonEdit.do?awardonId=${c.awardonId}&shopId=${c.shopId!}actionEdit=true" class="btn btn-primary">修改</a> 
</@shiro.hasPermission> 
<@shiro.hasPermission name="10.1.1.2">	   
   <a href="czjawardonDelete.do?ids=${c.awardonId}&shopId=${c.shopId!}" onclick="if(!confirm('您确定删除吗？')) {return false;}" class="btn btn-primary">删除</a>   
</@shiro.hasPermission>    
   </td>
            </tr>


        </#list>
        <#if 0==pagination.totalCount>
            <tr>
                <td colspan="7" style="color: red"> 没有相关数据 </td>
            </tr>
        </#if>




        </tbody>
    </table>
<#include "/view/admin/pagination.html"/>

   <br>

</div>
<script>
    $(function () {
        $('[data-toggle="popover"]').each(function () {
            var element = $(this);
            var id = element.attr('id');
            var count = '0';
            var key = $(this).parent().find('input[class=userinfoId]').attr('id');
            var userinfoId=$(this).parent().find('input[class=userinfoId]').val();
            var ticket=$(this).parent().find('input[class=ticket]').val();
            element.popover({
                trigger: 'manual',
                placement: 'bottom', //top, bottom, left or right
                title: '修改票数',

                html: 'true',
                content: ContentMethod(key,userinfoId,ticket),
            }).on("click", function () {
                var _this = this;
                $(this).popover("show");
               /* $(this).siblings(".popover").on("mouseleave", function () {
                    $(_this).popover('hide');
                });*/
            })/*.on("mouseleave", function () {

                var _this = this;
                setTimeout(function () {
                    if (!$(".popover:hover").length) {
                        $(_this).popover("hide")
                    }
                }, 100);
            })*/;
        });
    });
    function ContentMethod(key,userinfoId,ticket) {
        return '<form action="${base}/vote/savevotenum.do" method="POST"><table class="table table-bordered"><tr><td><input type="hidden"  name="id" value="'+userinfoId+'"/><input type="text" placeholder="票数" name="voteNum" value="'+ticket+'"/> </td></tr><tr><td><button type="submit" class="btn btn-success" >修改</button>&nbsp;&nbsp;<button type="button" class="btn btn-danger" onclick="closePPv('+key+')">取消</button> </td></tr></table></form>';
    }
    function closePPv(key){
        $(key).siblings('a[class=ppov]').popover('hide');
    }





</script>

</body>
</html>